import pymysql

conn = pymysql.connect(host='1.117.160.157', port=3306, user='root', passwd='qQ1002324991.', db='learn_db')

cursor = conn.cursor()

effect_row = cursor.execute('select * from user')
#返回文件行数
print(effect_row)
#返回第一条
# print(cursor.fetchone())
#返回所有
print(cursor.fetchall())
